package gui;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;

import common.MyButton;
import common.MyLabel;

public class DialogConfirmDone  extends JFrame{
	private FrameMain f = null;
	
	private MyLabel label = new MyLabel(new ImageIcon("./image/dialogConfirmDone.png"));
	String info = "Calculation has been finished sucessfully!";
	private MyButton ok = new MyButton(new ImageIcon("./image/ok.png"));
	private static String des="/homes/ma67/cs307/java/Library/";

	JLabel message = new JLabel(info);
	static JLabel location = new JLabel(des);
	JLabel message2 = new JLabel("Per requested, the result is stored as:");
	
	public DialogConfirmDone(FrameMain frameMain) {
		f = frameMain;
		
		setSize(451, 220);
		setResizable(false);
		
		label.setBounds(0, 0, 451, 220);
		// label.setLayout(new BoxLayout(label,BoxLayout.Y_AXIS));
		message.setBounds(90, 65, 451, 25);
		message2.setBounds(90,80,451,25);
		location.setBounds(90,95,451,25);
		ok.setBounds(150, 120, 154, 52);
		
		// text2.setBounds(x, y, width, height);
		label.add(message);
		label.add(location);
		label.add(message2);
		label.add(ok);
		
		this.add(label);
		MouseListener listenerOk = new MouseListener() {
			public void mouseEntered(MouseEvent e) {
			}

			public void mouseClicked(MouseEvent arg0) {
				f.getDialogConfirmDone().setVisible(false);
			}

			public void mouseExited(MouseEvent arg0) {
			}

			public void mousePressed(MouseEvent arg0) {
			}

			public void mouseReleased(MouseEvent arg0) {
			}
		};
		ok.addMouseListener(listenerOk);
	}
	public static void setPath(String des){
		location.setText(des);
	}
}
